package com.springbase.demo.service;

import com.springbase.demo.dto.People;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.cache.annotation.CachePut;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Repository;


/**
 * @Author: flyFan
 * @Date: 2021/9/14 16:27
 * @Version: 1.0
 */
@CacheConfig(cacheNames = "people")
@Repository
public interface PeopleService {
	
	@CachePut(key = "#p0.id")
	People update(People people);
	
	@CacheEvict(key = "#p0", allEntries = true)
	void delById(String id);
	
	@Cacheable(key = "#p0")
	People queryById(String id);
}
